﻿using System;
using System.Runtime.InteropServices;

namespace Padsurface.CoreAudio.Components.MMDevice.Interfaces
{
    /// <summary>
    /// Provides a callback to indicate that activation of a WASAPI interface is complete
    /// </summary>
    [ComImport, InterfaceType(ComInterfaceType.InterfaceIsIUnknown), Guid(ComIIDs.IActivateAudioInterfaceCompletionHandlerIID)]
    public interface IActivateAudioInterfaceCompletionHandler
    {
        /// <summary>
        /// Indicates that activation of a WASAPI interface is complete and results are available.
        /// </summary>
        /// <param name="activateOperation">An interface representing the asynchronous operation of activating the requested WASAPI interface</param>
        void ActivateCompleted(IActivateAudioInterfaceAsyncOperation activateOperation);

        /// <summary>
        /// Signals the succesful completion of the audio interface activation, 
        ///     the activated interface is passed as the EventArgs parameter
        /// </summary>
        event EventHandler<InterfaceActivatedEventArgs> InterfaceActivated;
    }
}
